<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>站点管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/shop/news/listZX">资讯列表</a></li>
		<li class="active"><a href="${ctx}/shop/news/formzx?id=${tNews.id}">站点${not empty tNews.id?'修改':'添加'}查看</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="tNews" action="${ctx}/shop/news/savezx" method="post" class="form-horizontal">
		<form:hidden path="rid"/>
		<sys:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">文章标题:</label>
			<div class="controls">
				<form:input path="titles" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">广告位置:</label>
			<div class="controls">
					<sys:treeselect id="tType"  name="tType.cCode" value="${tNews.TType.id}" labelName="parent.name" labelValue="${tNews.typeName}"
					title="父级节点" url="/shop/tType/treeData?cBelong=1" extId="${tType.id}" cssClass="input-xlarge required" allowClear="true" />
			</div>
		</div>
		
		
		<div class="control-group">
			<label class="control-label">来源:</label>
			<div class="controls">
				<form:input path="origin" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">关 键 词:</label>
			<div class="controls">
				<form:input path="keyword" htmlEscape="false" maxlength="60" class="input-xlarge "/>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">描述:</label>
			<div class="controls">
				<form:input path="city" htmlEscape="false" maxlength="60" class="input-xlarge "/>
			</div>
		</div>
			<div class="control-group">
			<label class="control-label">资讯排序:</label>
			<div class="controls">
				<form:input path="ctypeB" htmlEscape="false" maxlength="10" class="input-xlarge required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">正文内容:</label>
			<div class="controls">
				<form:textarea id="contents" htmlEscape="true" path="contents" rows="4" maxlength="200" class="input-xxlarge required"/>
				<sys:ckeditor replace="contents" uploadPath="/cms/site" />
			</div>
		</div>
		<form:hidden path="accept" value="0"/>
		<form:hidden path="modtype" value="0"/>
		<form:hidden path="enable" value="1"/>
		<div class="form-actions">
			<shiro:hasPermission name="cms:site:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>